check for parity of number javascript

51

check for parity of number javascript -

function isEven(n) {
   return n % 2 == 0;
}

function isOdd(n) {
   return Math.abs(n % 2) == 1;
}

Comments

Submit
0 Comments